package com.lhl.jwt.event;

import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.web.context.support.ServletRequestHandledEvent;

/**
 * @className: HttpRecodeEvent
 * @description: TODO 类描述
 * @author: king
 * @date: 2020-09-07 16:18
 **/
@Component
@Slf4j
public class HttpRecodeEvent implements ApplicationListener<ServletRequestHandledEvent> {
    @Override
    public void onApplicationEvent(ServletRequestHandledEvent servletRequestHandledEvent) {
        String clientAddress = servletRequestHandledEvent.getClientAddress();
        log.info("event == {}", JSONUtil.toJsonStr(servletRequestHandledEvent));
        log.debug("event == {}", JSONUtil.toJsonStr(servletRequestHandledEvent));
    }
}